﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="salesPercentageList.aspx.cs"
    Inherits="PeisongWeb.admin.salesPercentageList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register TagName="top" Src="controls/top.ascx" TagPrefix="uc1" %>
<%@ Register TagName="menu" Src="controls/menu.ascx" TagPrefix="uc2" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>销售提成管理</title>
    <!--#include file="style.inc"-->
</head>
<body>
    <form id="form1" runat="server">
    <ext:ScriptManager ID="ScriptManager1" runat="server" />
    <uc1:top ID="Top1" runat="server" />
    <uc2:menu ID="Menu1" runat="server" />
    <div id="admin-body">
        <h2 class="section-cms">
            销售提成管理</h2>
        <ext:Panel ID="Panel1" runat="server" Title="提成管理" BodyStyle="padding:5px 5px 0"
            Width="960" Frame="true" ButtonAlign="Center">
            <Body>
                <div id="admin_edit_content_search">
                    <ul>
                        <li style="width: auto; margin-right: 20px;">
                            <label>
                                销售员</label>
                            <asp:DropDownList runat="server" ID="ddl_Sales" DataTextField="realname" DataValueField="adminid">
                            </asp:DropDownList>
                        </li>
                        <li style="width: auto; margin-right: 20px">
                            <label>
                                年份
                            </label>
                            <asp:DropDownList runat="server" ID="ddlYear">
                                <asp:ListItem Value="2010">2010</asp:ListItem>
                                <asp:ListItem Value="2011">2011</asp:ListItem>
                                <asp:ListItem Value="2012">2012</asp:ListItem>
                                <asp:ListItem Value="2013">2013</asp:ListItem>
                                <asp:ListItem Value="2014">2014</asp:ListItem>
                            </asp:DropDownList>
                        </li>
                        <li style="width: auto; margin-right: 10px;">
                            <asp:Button runat="server" ID="btnSearch" Text="搜 索" OnClick="btnSearch_Click" />
                        </li>
                        <li style="width: auto;">
                            <asp:Button runat="server" ID="btn_Create" Text="初始化" OnClick="btn_Create_Click" />
                        </li>
                    </ul>
                </div>
            </Body>
        </ext:Panel>
        <p>
            &nbsp;</p>
        <div id="admin_list_content">
            <table cellpadding="0" cellspacing="0">
                <tr class="header-row">
                    <th>
                        季度
                    </th>
                    <th>
                        开始日期
                    </th>
                    <th>
                        结束日期
                    </th>
                    <th>
                        创建人
                    </th>
                    <th>
                        创建日期
                    </th>
                    <th>
                        操作
                    </th>
                </tr>
                <asp:Repeater ID="rpt_list" runat="server" OnItemCommand="rpt_list_ItemCommand">
                    <ItemTemplate>
                        <tr>
                            <td>
                                第<%# DataBinder.Eval(Container.DataItem,"season") %>季度
                            </td>
                            <td>
                                <%# DataBinder.Eval(Container.DataItem,"startDt","{0:yyyy-MM-dd}") %>
                            </td>
                            <td>
                                <%# DataBinder.Eval(Container.DataItem,"endDt","{0:yyyy-MM-dd}") %>
                            </td>
                            <td>
                                <%# DataBinder.Eval(Container.DataItem, "username")%>
                            </td>
                            <td>
                                <%# DataBinder.Eval(Container.DataItem,"inputDt") %>
                            </td>
                            <td>
                                <asp:LinkButton runat="server" ID="lnt_calculate" Text="结算提成" CommandName="Calculate"
                                    CommandArgument='<%# Eval("did") %>' OnClientClick="javascript:return confirm('你确定结算当前销售人员的提成吗?')"
                                    Visible=' <%# Convert.ToInt32(Eval("isCreate"))==1?false:true %>'></asp:LinkButton>
                                <asp:LinkButton runat="server" ID="lnt_select" Text="查看" CommandName="Select" CommandArgument='<%# Eval("did") %>'
                                    Visible=' <%# Convert.ToInt32(Eval("isCreate"))==1?true:false %>'></asp:LinkButton>
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </table>
        </div>
        <ext:Window ID="sale_Percentage" runat="server" Title="提成" Height="550px" Width="920px"
            BodyStyle="padding: 6px; background-color: #fff;" AutoScroll="true" Modal="True"
            Resizable="false" ShowOnLoad="false" Draggable="false" Icon="ApplicationViewDetail">
            <Body>
                <div class="details">
                    <h2>
                        <asp:Label runat="server" ID="lbl_title"></asp:Label>
                    </h2>
                    <hr />
                    <ul>
                        <li>
                            <label>
                                销售员：</label>
                            <asp:Label runat="server" ID="lbl_salesName"></asp:Label>
                        </li>
                        <li>
                            <label>
                                日期：</label>
                            <asp:Label runat="server" ID="lbl_year"></asp:Label>
                            <asp:Label runat="server" ID="lbl_startDt"></asp:Label>至
                            <asp:Label runat="server" ID="lbl_endDt"></asp:Label>
                        </li>
                    </ul>
                    <p>
                        &nbsp;</p>
                    <table width="98%" border="0" cellpadding="4" cellspacing="1" style="text-align: left">
                        <tr>
                            <td>
                                <h2>
                                    提成信息
                                </h2>
                                <hr />
                            </td>
                        </tr>
                    </table>
                    <table width="98%" border="0" cellpadding="4" cellspacing="1" bgcolor="#99BBE8" style="text-align: left">
                        <tr align="center" style="height: 20px;">
                            <td width="5%" bgcolor="#C0D5F0">
                                序号
                            </td>
                            <td width="23%" bgcolor="#C0D5F0">
                                企业名称
                            </td>
                            <td width="10%" bgcolor="#C0D5F0">
                                日订购量
                            </td>
                            <td width="10%" bgcolor="#C0D5F0">
                                本季订购量
                            </td>
                            <td width="10%" bgcolor="#C0D5F0">
                                季度提成系数
                            </td>
                            <td width="10%" bgcolor="#C0D5F0">
                                季度提成
                            </td>
                            <td width="10%" bgcolor="#C0D5F0">
                                年底提成系数
                            </td>
                            <td width="10%" bgcolor="#C0D5F0">
                                年底提成
                            </td>
                            <td width="10%" bgcolor="#C0D5F0">
                                合计
                            </td>
                        </tr>
                        <asp:Repeater runat="server" ID="rpt_PercentageList">
                            <ItemTemplate>
                                <tr align="center" style="height: 20px;">
                                    <td bgcolor="#FFFFFF">
                                        <%# Container.ItemIndex+1%>
                                    </td>
                                    <td bgcolor="#FFFFFF">
                                        <%#Eval("company")%>
                                    </td>
                                    <td bgcolor="#FFFFFF">
                                        <%#string.Format("{0:F2}",Eval("avgDailySaleRoom"))%>
                                    </td>
                                    <td bgcolor="#FFFFFF">
                                        <%#string.Format("{0:F2}", Eval("seasonSaleRoom"))%>
                                    </td>
                                    <td bgcolor="#FFFFFF">
                                        <%#string.Format("{0:F1}", Eval("seasonRate"))%>%
                                    </td>
                                    <td bgcolor="#FFFFFF">
                                        <asp:Literal runat="server" ID="ltl_sp" Text='<%#string.Format("{0:F2}", Eval("seasonPercentage"))%>'></asp:Literal>
                                    </td>
                                    <td bgcolor="#FFFFFF">
                                        <%#string.Format("{0:F1}", Eval("yearendRate"))%>%
                                    </td>
                                    <td bgcolor="#FFFFFF">
                                        <asp:Literal runat="server" ID="ltl_yp" Text='<%#string.Format("{0:F2}", Eval("yearendPercentage"))%>'></asp:Literal>
                                    </td>
                                    <td bgcolor="#FFFFFF">
                                        <asp:Literal runat="server" ID="lbl_amount" Text='<%#string.Format("{0:F2}", Convert.ToDecimal(Eval("seasonPercentage")) + Convert.ToDecimal(Eval("yearendPercentage")))%>'></asp:Literal>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                        <tr align="center" style="height: 20px;">
                            <td bgcolor="#C0D5F0" colspan="5">
                                合&nbsp;&nbsp;计
                            </td>
                            <td bgcolor="#FFFFFF">
                                ￥<asp:Label runat="server" ID="lbl_sumSeason"></asp:Label>
                                &nbsp;
                            </td>
                            <td bgcolor="#FFFFFF">
                            </td>
                            <td bgcolor="#FFFFFF">
                                ￥<asp:Label runat="server" ID="lbl_sumYearEnd"></asp:Label>
                                &nbsp;
                            </td>
                            <td bgcolor="#FFFFFF" align="right">
                                ￥<asp:Label runat="server" CssClass="red" ID="lbl_sum"></asp:Label>
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                </div>
            </Body>
        </ext:Window>
    </div>
    </form>
</body>
</html>
